﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Drawing;

namespace TankWin.Classes
{
    class ObjHeart
    {
        protected Point _position;
        protected Image[] _image;
        protected EStatusTank _status;

        #region property
        public Point Position
        {
            get { return _position; }
            set { _position = value; }
        }
        public Image[] ImageH
        {
            get { return _image; }
            set { _image = value; }
        }
        public EStatusTank Status
        {
            get { return _status; }
            set { _status = value; }
        }
        #endregion
        private Image _AliveHeart = global::TankWin.ImageTank.AliveHeart;
        private Image _DeadHeart = global::TankWin.ImageTank.DeadHeart;
        public ObjHeart(Point _p)
        {
            _status = EStatusTank.IsAlive;
            this._position = _p;
            //Load vao 2 buc anh song va chet
            _image = new Image[2]
            {
                _AliveHeart,
                _DeadHeart
            };
         }
        public void Draw(Graphics _g)
        {
            if (_status == EStatusTank.IsAlive)
            {
                _g.DrawImageUnscaled(_image[0], _position);
            }
            else _g.DrawImageUnscaled(_image[1], _position);
        }

    }
}
